3.246 \(\int (a \sin (c+d x)+b \tan (c+d x))^3 \, dx\)

Optimal. Leaf size=116 \[ \frac {a^3 \cos ^3(c+d x)}{3 d}-\frac {a \left (a^2-3 b^2\right ) \cos (c+d x)}{d}-\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a^2 b \cos ^2(c+d x)}{2 d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec ^2(c+d x)}{2 d} \]

[Out]

-a*(a^2-3*b^2)*cos(d*x+c)/d+3/2*a^2*b*cos(d*x+c)^2/d+1/3*a^3*cos(d*x+c)^3/d-b*(3*a^2-b^2)*ln(cos(d*x+c))/d+3*a
*b^2*sec(d*x+c)/d+1/2*b^3*sec(d*x+c)^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 116, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.158, Rules used = {4397, 2721, 894} \[ -\frac {a \left (a^2-3 b^2\right ) \cos (c+d x)}{d}-\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a^2 b \cos ^2(c+d x)}{2 d}+\frac {a^3 \cos ^3(c+d x)}{3 d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec ^2(c+d x)}{2 d} \]

Antiderivative was successfully verified.

[In]

Int[(a*Sin[c + d*x] + b*Tan[c + d*x])^3,x]

[Out]

-((a*(a^2 - 3*b^2)*Cos[c + d*x])/d) + (3*a^2*b*Cos[c + d*x]^2)/(2*d) + (a^3*Cos[c + d*x]^3)/(3*d) - (b*(3*a^2
- b^2)*Log[Cos[c + d*x]])/d + (3*a*b^2*Sec[c + d*x])/d + (b^3*Sec[c + d*x]^2)/(2*d)

Rule 894

Int[((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_))^(n_)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIn
tegrand[(d + e*x)^m*(f + g*x)^n*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[e*f - d*g, 0] &&
NeQ[c*d^2 + a*e^2, 0] && IntegerQ[p] && ((EqQ[p, 1] && IntegersQ[m, n]) || (ILtQ[m, 0] && ILtQ[n, 0]))

Rule 2721

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(p_.), x_Symbol] :> Dist[1/f, Subst[I
nt[(x^p*(a + x)^m)/(b^2 - x^2)^((p + 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x] && NeQ[a^2
 - b^2, 0] && IntegerQ[(p + 1)/2]

Rule 4397

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rubi steps

\begin {align*} \int (a \sin (c+d x)+b \tan (c+d x))^3 \, dx &=\int (b+a \cos (c+d x))^3 \tan ^3(c+d x) \, dx\\ &=-\frac {\operatorname {Subst}\left (\int \frac {(b+x)^3 \left (a^2-x^2\right )}{x^3} \, dx,x,a \cos (c+d x)\right )}{d}\\ &=-\frac {\operatorname {Subst}\left (\int \left (a^2 \left (1-\frac {3 b^2}{a^2}\right )+\frac {a^2 b^3}{x^3}+\frac {3 a^2 b^2}{x^2}+\frac {3 a^2 b-b^3}{x}-3 b x-x^2\right ) \, dx,x,a \cos (c+d x)\right )}{d}\\ &=-\frac {a \left (a^2-3 b^2\right ) \cos (c+d x)}{d}+\frac {3 a^2 b \cos ^2(c+d x)}{2 d}+\frac {a^3 \cos ^3(c+d x)}{3 d}-\frac {b \left (3 a^2-b^2\right ) \log (\cos (c+d x))}{d}+\frac {3 a b^2 \sec (c+d x)}{d}+\frac {b^3 \sec ^2(c+d x)}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.29, size = 102, normalized size = 0.88 \[ \frac {a^3 \cos (3 (c+d x))-9 a \left (a^2-4 b^2\right ) \cos (c+d x)+9 a^2 b \cos (2 (c+d x))-36 a^2 b \log (\cos (c+d x))+36 a b^2 \sec (c+d x)+6 b^3 \sec ^2(c+d x)+12 b^3 \log (\cos (c+d x))}{12 d} \]

Antiderivative was successfully verified.

[In]

Integrate[(a*Sin[c + d*x] + b*Tan[c + d*x])^3,x]

[Out]

(-9*a*(a^2 - 4*b^2)*Cos[c + d*x] + 9*a^2*b*Cos[2*(c + d*x)] + a^3*Cos[3*(c + d*x)] - 36*a^2*b*Log[Cos[c + d*x]
] + 12*b^3*Log[Cos[c + d*x]] + 36*a*b^2*Sec[c + d*x] + 6*b^3*Sec[c + d*x]^2)/(12*d)

________________________________________________________________________________________

fricas [A]  time = 0.61, size = 123, normalized size = 1.06 \[ \frac {4 \, a^{3} \cos \left (d x + c\right )^{5} + 18 \, a^{2} b \cos \left (d x + c\right )^{4} - 9 \, a^{2} b \cos \left (d x + c\right )^{2} + 36 \, a b^{2} \cos \left (d x + c\right ) - 12 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{3} - 12 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\cos \left (d x + c\right )\right ) + 6 \, b^{3}}{12 \, d \cos \left (d x + c\right )^{2}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*sin(d*x+c)+b*tan(d*x+c))^3,x, algorithm="fricas")

[Out]

1/12*(4*a^3*cos(d*x + c)^5 + 18*a^2*b*cos(d*x + c)^4 - 9*a^2*b*cos(d*x + c)^2 + 36*a*b^2*cos(d*x + c) - 12*(a^
3 - 3*a*b^2)*cos(d*x + c)^3 - 12*(3*a^2*b - b^3)*cos(d*x + c)^2*log(-cos(d*x + c)) + 6*b^3)/(d*cos(d*x + c)^2)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: TypeError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*sin(d*x+c)+b*tan(d*x+c))^3,x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,x):;OUTPUT:Modg
cd: no suitable evaluation pointindex.cc index_m operator + Error: Bad Argument ValueUnable to check sign: (2*
pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Una
ble to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*
pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Una
ble to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*
pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Una
ble to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*
pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Una
ble to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*
pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Unable to check sign: (2*pi/x/2)>(-2*pi/x/2)Una
ble to check sign: (2*pi/x/2)>(-2*pi/x/2)Evaluation time: 62.4Done

________________________________________________________________________________________

maple [A]  time = 0.08, size = 164, normalized size = 1.41 \[ -\frac {\cos \left (d x +c \right ) \left (\sin ^{2}\left (d x +c \right )\right ) a^{3}}{3 d}-\frac {2 a^{3} \cos \left (d x +c \right )}{3 d}-\frac {3 a^{2} b \left (\sin ^{2}\left (d x +c \right )\right )}{2 d}-\frac {3 a^{2} b \ln \left (\cos \left (d x +c \right )\right )}{d}+\frac {3 a \,b^{2} \left (\sin ^{4}\left (d x +c \right )\right )}{d \cos \left (d x +c \right )}+\frac {3 \cos \left (d x +c \right ) \left (\sin ^{2}\left (d x +c \right )\right ) a \,b^{2}}{d}+\frac {6 a \,b^{2} \cos \left (d x +c \right )}{d}+\frac {b^{3} \left (\tan ^{2}\left (d x +c \right )\right )}{2 d}+\frac {b^{3} \ln \left (\cos \left (d x +c \right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*sin(d*x+c)+b*tan(d*x+c))^3,x)

[Out]

-1/3/d*cos(d*x+c)*sin(d*x+c)^2*a^3-2/3*a^3*cos(d*x+c)/d-3/2/d*a^2*b*sin(d*x+c)^2-3*a^2*b*ln(cos(d*x+c))/d+3/d*
a*b^2*sin(d*x+c)^4/cos(d*x+c)+3/d*cos(d*x+c)*sin(d*x+c)^2*a*b^2+6*a*b^2*cos(d*x+c)/d+1/2/d*b^3*tan(d*x+c)^2+b^
3*ln(cos(d*x+c))/d

________________________________________________________________________________________

maxima [A]  time = 0.42, size = 113, normalized size = 0.97 \[ \frac {{\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} a^{3}}{3 \, d} - \frac {3 \, {\left (\sin \left (d x + c\right )^{2} + \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )} a^{2} b}{2 \, d} - \frac {b^{3} {\left (\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )\right )}}{2 \, d} + \frac {3 \, a b^{2} {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*sin(d*x+c)+b*tan(d*x+c))^3,x, algorithm="maxima")

[Out]

1/3*(cos(d*x + c)^3 - 3*cos(d*x + c))*a^3/d - 3/2*(sin(d*x + c)^2 + log(sin(d*x + c)^2 - 1))*a^2*b/d - 1/2*b^3
*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/d + 3*a*b^2*(1/cos(d*x + c) + cos(d*x + c))/d

________________________________________________________________________________________

mupad [B]  time = 4.52, size = 219, normalized size = 1.89 \[ \frac {{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (-\frac {4\,a^3}{3}-6\,a^2\,b+12\,a\,b^2+2\,b^3\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (4\,a^3-6\,a^2\,b+12\,a\,b^2-6\,b^3\right )+{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (\frac {20\,a^3}{3}+6\,a^2\,b-12\,a\,b^2+6\,b^3\right )+12\,a\,b^2-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (6\,a^2\,b-2\,b^3\right )-\frac {4\,a^3}{3}}{d\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )}^2\,{\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}^3}-\frac {2\,b^3\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )-6\,a^2\,b\,\mathrm {atanh}\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*sin(c + d*x) + b*tan(c + d*x))^3,x)

[Out]

(tan(c/2 + (d*x)/2)^2*(12*a*b^2 - 6*a^2*b - (4*a^3)/3 + 2*b^3) - tan(c/2 + (d*x)/2)^6*(12*a*b^2 - 6*a^2*b + 4*
a^3 - 6*b^3) + tan(c/2 + (d*x)/2)^4*(6*a^2*b - 12*a*b^2 + (20*a^3)/3 + 6*b^3) + 12*a*b^2 - tan(c/2 + (d*x)/2)^
8*(6*a^2*b - 2*b^3) - (4*a^3)/3)/(d*(tan(c/2 + (d*x)/2)^2 - 1)^2*(tan(c/2 + (d*x)/2)^2 + 1)^3) - (2*b^3*atanh(
tan(c/2 + (d*x)/2)^2) - 6*a^2*b*atanh(tan(c/2 + (d*x)/2)^2))/d

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (a \sin {\left (c + d x \right )} + b \tan {\left (c + d x \right )}\right )^{3}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*sin(d*x+c)+b*tan(d*x+c))**3,x)

[Out]

Integral((a*sin(c + d*x) + b*tan(c + d*x))**3, x)

________________________________________________________________________________________